# Figure S5: Conditional AMCE correlation holding income constant

fig4a_dat = bind_rows(import(here("data","fig4a_inc_agree_dat.rds")) |> 
                        mutate(agree = "Agree"),
                      import(here("data","fig4a_inc_disagree_dat.rds")) |> 
                        mutate(agree = "Disagree")) |> 
  invert_group()

figa_edu_agree_scat = amce_scatterplot(fig4a_dat, "Education", "darkgreen", -0.1, .5, "Agree")
figa_edu_disagree_scat = amce_scatterplot(fig4a_dat, "Education", "darkgreen", -0.1, .5, "Disagree")

figa_edu_scat = figa_edu_agree_scat + figa_edu_disagree_scat

print(figa_edu_scat)

ggsave(here("figures","appendix","figure_s5.png"), figa_edu_scat,
       dpi = 600, units = "in", width = 10, height = 5)

ccat("See 'figure_s5.png' for Figure S5 output")